#include<bits/stdc++.h>
using namespace std;
int n,ans,maxn;
int bot[100005],ky[100005];
inline int getmin(int idx){
	for(int i=idx;i<=maxn;i++){
		if(bot[i]!=0) return i;
	}
	return -1;
}

int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	ans=n;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		maxn=max(maxn,x);
		bot[x]++;
		ky[x]++;
	}
	int now=getmin(1);
	while(1){
		int minkyi=getmin(now+1);
		while(minkyi!=-1&&ky[minkyi]==0) minkyi=getmin(minkyi+1);
		if(minkyi==-1) break;
		int howmany=min(bot[now],ky[minkyi]);
		bot[now]-=howmany;
		ky[now]-=howmany;
		ky[minkyi]-=howmany;
		ans-=howmany;
		if(bot[now]==0) now=getmin(now+1);
	}
	cout<<ans;
	return 0;
}
